/**
 * 〈〉
 * 考核标准
 * @author 王青杰
 * @create 2018-08-0810:25
 * @since 1.0.0
 */
package org.wlgzs.website.wlgzsoffice.controller.assess;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.wlgzs.website.wlgzsoffice.entity.TbCriteria;
import org.wlgzs.website.wlgzsoffice.service.CriteriaService;
import org.wlgzs.website.wlgzsoffice.util.ResultMsg;

import javax.annotation.Resource;


@RestController
@RequestMapping("assess/criteria")
public class CriteriaController {

    @Resource
    CriteriaService criteriaService;

    @RequestMapping(value = "/insert",method = RequestMethod.POST)
    public ResultMsg insert(TbCriteria criteria){
        return criteriaService.insert(criteria);
    }

    @RequestMapping(value = "/delete",method = RequestMethod.POST)
    public ResultMsg delete(int criteriaId){
        return  criteriaService.delete(criteriaId);
    }

    @RequestMapping(value = "/update",method = RequestMethod.POST)
    public ResultMsg update(TbCriteria criteria){
        return criteriaService.update(criteria);
    }

    @RequestMapping("/getAllCriteria")
    public ResultMsg getAllCriteria(int pageNum){
        return criteriaService.getAllCriteria(pageNum);
    }

    @RequestMapping(value = "/checkByKey",method = RequestMethod.POST)

    public ResultMsg checkByKey(int pageNum,TbCriteria criteria){
        return criteriaService.checkByKey(pageNum,criteria);
    }

}
